﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Drifting.MotionPlanning.Primitives
{
    public class State
    {
        protected Representation rep;   // refactorize this field into a derived class
        protected double[] q;   // this is the value used in propagation
        protected double[] alias;   // this is the value used in near neighbors queries
        int list_index;
        double cost_value;
        Edge parentEdge_value;

        private State()
        {
            cost_value = 0;
            parentEdge_value = null;
            q = null;
            alias = null;
        }

        public State(double[] q, double[] alias)
        {
            cost_value = 0;
            parentEdge_value = null;
            this.q = q;
            this.alias = alias;
        }

        public double[] Q
        {
            get { return q; }
            set { q = value; }
        }

        public double[] Alias
        {
            get { return alias; }
            set { alias = value; }
        }
        
        public int Index
        {
            get { return list_index; }
            set { list_index = value; }
        }

        public double Cost
        {
            get { return cost_value; }
            set { cost_value = value;}
        }

        public Edge ParentEdge
        {
            get { return parentEdge_value; }
            set { parentEdge_value = value; }
        }

        public Representation Witness
        {
            get { return rep; }
            set { this.rep = value; }
        }
    }
}
